<template>
	<view style="padding: 30rpx;">
		<!-- <view 
			style="background-color: #fff;border-radius: 16rpx;">
			<u-cell-item v-for="(item,index) in dataList" :key="index" :title="item.name" :value="item.dailyProcessingCapacity"
			 :label="item.enterpriseName" @click="toDetail(item.id)"></u-cell-item>
		</view> -->
		<view v-for="(item,index) in dataList" :key="index" @click="toDetail(item.id)"
			style="padding: 30rpx;background-color: #fff;border-radius: 16rpx;margin-bottom: 20rpx;">
			<view style="display: flex;align-items: center;justify-content: space-between;">
				<view style="font-size: 32rpx;width: 80%;">{{item.soilName }}</view>
				<view style="font-size: 24rpx;width: 20%;text-align: end;">施工中</view>
			</view>
			<view style="margin-top: 10rpx;">
				<text>工地类型：</text>
				<text style="margin-left: 5rpx;color: #999;">{{item.categoryText}}</text>
			</view>
			<view style="margin-top: 10rpx;">
				<text>详细地址：</text>
				<text style="margin-left: 5rpx;color: #999;">{{item.address}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageNum: 1,
				pageSize: 20,
				dataList: [],
			}
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData() {
				//  1.砂石土场、2.土方土场、3.建筑垃圾土场、4.渣土土场、5.灰浆等流体土场、6.其他土场
				this.$u.get("/driver/soilSiteInfoPage", {
					// 'pageNum': this.pageNum,
					// 'pageSize': this.pageSize
				}).then(res => {
					if (res.code == 200) {
						let dataList = res.rows
						for (let s of dataList) {
							switch (s.category) {
								case '1':
									s.categoryText = '砂石土场'
									break;
								case '2':
									s.categoryText = '土方土场'
									break;
								case '3':
									s.categoryText = '建筑垃圾土场'
									break;
								case '4':
									s.categoryText = '渣土土场'
									break;
								case '5':
									s.categoryText = '灰浆等流体土场'
									break;
								case '6':
									s.categoryText = '其他土场'
									break;
								default:
									break;
							}
						}
						this.dataList = dataList
					}
				})
			},

			toDetail(id) {
				uni.navigateTo({
					url: "detail/detail?id=" + id
				})
			}

		}
	}
</script>

<style>

</style>